package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1TrapInstance;

public class S_Trap extends ServerBasePacket {
  private byte[] _byte;
  
  public S_Trap(L1TrapInstance trap, String name) {
    this._byte = null;
    writeC(87);
    writeH(trap.getX());
    writeH(trap.getY());
    writeD(trap.getId());
    writeH(7);
    writeC(0);
    writeC(0);
    writeC(0);
    writeC(0);
    writeD(0);
    writeH(0);
    writeS(name);
    writeS(null);
    writeC(0);
    writeD(0);
    writeS(null);
    writeS(null);
    writeC(0);
    writeC(255);
    writeC(0);
    writeC(0);
    writeC(0);
    writeC(255);
    writeC(255);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
